﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: ${USER}
Date: ${DATE}
Time: ${TIME}
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%= basePath %>"/>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
<script type="text/javascript" src="<%= basePath %>static/backstage/lib/html5shiv.js"></script>
<script type="text/javascript" src="<%= basePath %>static/backstage/lib/respond.min.js"></script>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="<%= basePath %>static/backstage/static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="<%= basePath %>static/backstage/static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="<%= basePath %>static/backstage/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css"
          href="<%= basePath %>static/backstage/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="<%= basePath %>static/backstage/static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
<script type="text/javascript" src="<%= basePath %>static/backstage/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>商品列表</title>
    <base href="<%= basePath %>"/>
    <link rel="stylesheet" href="<%= basePath %>static/backstage/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css"
          type="text/css">
    <style type="text/css">
        .imgc {
            width: 60px !important;
        }
    </style>
</head>
<body class="pos-r">
<%--<div class="pos-a"--%>
<%--     style="width:200px;left:0;top:0; bottom:0; height:100%; border-right:1px solid #e5e5e5; background-color:#f5f5f5; overflow:auto;">--%>
<%--    <ul id="treeDemo" class="ztree"></ul>--%>
<%--</div>--%>
<div>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> <a href="olalashop/sysAccountApi/index">首页</a>
        <span class="c-gray en">&gt;</span> 商品管理
        <span class="c-gray en">&gt;</span> 商品列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新">
            <i class="Hui-iconfont">&#xe68f;</i>
        </a>
    </nav>
    <div class="page-container">
        <div class="text-c">
            <input type="text" name="nameInfo" id="nameInfo" placeholder="请输入商品名称关键字" style="width:250px"
                   class="input-text" value="${nameInfo}">
            <button onclick="goodsSeacher()" class="btn btn-success" type="submit">
                <i class="Hui-iconfont">&#xe665;</i> 搜索商品
            </button>
        </div>

        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l">
<%--                <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius">--%>
<%--                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> --%>
                <a class="btn btn-primary radius"
                   href="<%= basePath %>static/backstage/product-add.jsp"><i
                        class="Hui-iconfont">&#xe600;</i> 添加商品</a>
            </span>
            <span class="r">共有数据：<strong>${goods.size()}</strong> 条</span></div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                <tr class="text-c">
                    <%--                    <th width="50"><input name="" type="checkbox" value=""></th>--%>
                    <th width="60">商品ID</th>
                    <th width="100">商品分类</th>
                    <th width="150">商品名称</th>
                    <th width="100">关键字</th>
                    <th width="150">所属店铺</th>
                    <th width="60">缩略图</th>
                    <th width="150">商品描述</th>
                    <th width="100">市场价</th>
                    <th width="100">本店售价</th>
                    <th width="100">促销价格</th>
                    <th width="60">是否开售</th>
                    <th width="100">操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${goods}" var="product">
                    <tr>
                            <%--                        <td width="50"><input name="" type="checkbox" value=""></td>--%>
                        <td width="60">${product.goodsId}</td>
                        <td width="100">${product.goodsCategory.categoryName}</td>
                        <td width="150">${product.goodsName}</td>
                        <td width="100">${product.keywords}</td>
                        <td width="150">${product.goodsBusiness.businessName}</td>
                        <td width="60"><img class="imgc"
                                            src="static/${product.GPicture[0].thumbImg}"/></td>
                        <td width="150">${product.goodsDescrible}</td>
                        <td width="100">${product.marketPrice}元</td>
                        <td width="100">${product.shopPrice}元</td>
                        <td width="100">${product.promotePrice}元</td>
                        <td width="60">
                            <c:choose>
                                <c:when test="${product.isOnsale==1}">
                                    <span><h5>已开售</h5></span>
                                </c:when>
                                <c:otherwise>
                                    <span><h5>未开售</h5></span>
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td width="100">
                            <a href="editGoodsInfo/${product.goodsId}">编辑</a>
                            <a href="#">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="<%= basePath %>static/backstage/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="<%= basePath %>static/backstage/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="<%= basePath %>static/backstage/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="<%= basePath %>static/backstage/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript"
        src="<%= basePath %>static/backstage/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="<%= basePath %>static/backstage/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript"
        src="<%= basePath %>static/backstage/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<%= basePath %>static/backstage/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    function goodsSeacher() {
        var nameInfo = $("#nameInfo").val();
        console.log(nameInfo)
        window.location.href = "allGoodsInfo/seacherGoodsByName?nameInfo=" + nameInfo
    }
</script>
</body>
</html>